use ruma::{OwnedServerName, OwnedUserId};

#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub enum Destination {
    Appservice(String),
    Push(OwnedUserId, String), // user and pushkey
    Normal(OwnedServerName),
}
impl Destination {
    pub fn get_prefix(&self) -> Vec<u8> {
        match self {
            Self::Normal(server) => {
                let len = server.as_bytes().len().saturating_add(1);

                let mut p = Vec::with_capacity(len);
                p.extend_from_slice(server.as_bytes());
                p.push(0xFF);
                p
            }
            _ => unimplemented!(),
        }
    }
}
